package com.example.entity;

public class Student {
    private String name;
    private int age;

    public Student() {
        this.name = "Default Student";
        this.age = 18;
        System.out.println("Student no-arg constructor called");
    }

    public Student(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Student parameterized constructor called: " + name + ", " + age);
    }

    public void introduce() {
        System.out.println("Hello, I'm " + name + ", " + age + " years old.");
    }

    public void study(String subject) {
        System.out.println(name + " is studying " + subject);
    }

    public String getGrade(String subject, int score) {
        return name + " got " + score + " in " + subject;
    }

    // Getter and Setter methods
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "Student{name='" + name + "', age=" + age + "}";
    }
}